{% extends 'bootstrap-modal-layout.html.twig' %}

{% set modalSize = 'large' %}
{% block title %}{{'material_lib.my_sharing'|trans}}{% endblock %}

{% do script(['libs/jquery-validation.js', 'libs/select2.js', 'app/js/material-lib/share/index.js'])%}

{% block body %}
  <form id="share-materials-form" class="form-horizontal" method="post"
    action="{{ path('material_lib_save_sharing') }}">
    <div class="form-group">
      <label class="col-md-3 control-label">{{'material_lib.my_sharing.share_to'|trans}}</label>
      <div class="col-md-8 controls">
        <input class="width-full select2-offscreen" name="targetUserIds"
          id="target-teachers-input" placeholder="{{'material_lib.my_sharing.share_to.input_placeholder'|trans}}">
      </div>
    </div>
    <div class="hidden" id="target-teachers-data" data-value="{{ teacherData|json_encode }}"></div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
{% endblock %} 

{% block footer %}
  <button id="form-submit" type="button"
    class="btn btn-primary pull-right" data-toggle="form-submit"
    data-target="#share-materials-form" data-loading-text="{{'form.btn.save.submiting'|trans}}">
    {{'form.btn.save'|trans}}
  </button>
  <button type="button" class="btn btn-link pull-right" data-dismiss="modal">
    {{'form.btn.cancel'|trans}}
  </button>
{% endblock %}
